package cn.sdormitory.knowledgebase.pojo;

import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;


/**
 * @author yy
 */

@Data
@TableName(value ="study_questions")
public class StudyQuestions {

    @TableId(value="id")
    @ApiModelProperty(value="试题的唯一标识")
    private Integer id;

    @TableField(value="content")
    @ApiModelProperty(value="题目内容（支持文本、公式、图片等富文本内容）")
    private String content;

    @TableField(value="type")
    @ApiModelProperty(value="题目类型（1单选、2多选、3判断、4填空、5简答）")
    private Integer type;

    @TableField(value="category")
    @ApiModelProperty(value="题目类别")
    private Integer category;

    @TableField(value="`option`")
    @ApiModelProperty(value="选项列表，适用于单选和多选题（JSON 格式）")
    private String option;

    @TableField(value="answer")
    @ApiModelProperty(value="正确答案（支持单选、多选、填空题答案，或简答题的参考答案）")
    private String answer;

    @TableField(value="score")
    @ApiModelProperty(value="题目分数")
    private Integer score;

    @TableField(value="analysis")
    @ApiModelProperty(value="试题解析")
    private String analysis;

    @TableField(value="create_time")
    @ApiModelProperty(value="创建时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(value="modify_time")
    @ApiModelProperty(value="更新时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifyTime;

}
